<? 
	require("required/dbconnect.php");
		
	$enid=$_GET['id'];
	$enpass=$_GET['dbase'];
	$id=($enid/(-25))+983421-$enpass;
	$activatecode=$_GET['activatecode'];
	
	
	
	$match=mysql_query("select * from os_member where id=$id");
	
	
	if(mysql_num_rows($match)!=0)
	{
		if(mysql_result($match,0,'activate_code')==$activatecode)
		{
			if(mysql_result($match,0,'status')=='activated')
			{
				$msg=1;
			}
			else
			{
				$msg=2;
				$_SESSION['member_status']="activated";
				$_SESSION['member_type']=mysql_result($match,0,'member_type');
				$_SESSION['loginid']=mysql_result($match,0,'id');
				$_SESSION['loginname']=mysql_result($match,0,'name');
				$update=mysql_query("update os_member set status='activated',total_login=total_login+1 where id=$id")or die(mysql_error());
			}
		}
		else
		{
			$msg=3;
		}
	}
	else
	{
		$msg=3;
	}
	
	header("Location:memberactivate2.php?msg=$msg");	
?>

